package com.superman;

import com.superman.serialize.MessageTypeDeserializer;
import com.superman.serialize.MessageTypeSerializer;

import net.mof.manual.JsonMark;
import net.mof.manual.ManualDeserializer;
import net.mof.manual.ManualJsonProperty;
import net.mof.manual.ManualSerializer;
import net.mof.manual.ManualUnknowMap;
import net.mof.manual.sub.SubType;
import net.mof.manual.sub.SubTypeMap;

import java.io.Serializable;
import java.util.HashMap;

@JsonMark
@SubTypeMap({@SubType(value = TextMessage.class, name = "text")})
public class Message implements Serializable {

	@ManualJsonProperty("type")
	@ManualDeserializer(MessageTypeDeserializer.class)
	@ManualSerializer(MessageTypeSerializer.class)
	private MessageType type;

	@ManualJsonProperty("label")
	private String label;

	@ManualJsonProperty("rmid")
	private String rmid;

	@ManualJsonProperty("first")
	private String first;

	@ManualJsonProperty("ver")
	private int ver = 1;

	@ManualUnknowMap
	@ManualJsonProperty("unknow_property")
	private HashMap<String, Object> unknow_property;

	public MessageType getType() {
		return type;
	}

	public void setType(MessageType type) {
		this.type = type;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getRmid() {
		return rmid;
	}

	public void setRmid(String rmid) {
		this.rmid = rmid;
	}

	public String getFirst() {
		return first;
	}

	public void setFirst(String first) {
		this.first = first;
	}

	public int getVer() {
		return ver;
	}

	public void setVer(int ver) {
		this.ver = ver;
	}

	public HashMap<String, Object> getUnknow_property() {
		return unknow_property;
	}

	public void setUnknow_property(HashMap<String, Object> unknow_property) {
		this.unknow_property = unknow_property;
	}
}
